package com.woniuxy01;

import java.util.Scanner;

public class Test06 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        boolean flag=false;
        for(int i=1;i<=3;i++){
            System.out.println("输入用户名");
            String uname = scanner.next();
            System.out.println("输入密码");
            String pwd = scanner.next();
            if(uname.equals("a")&&"aaa".equals(pwd)){
                flag=true;
                break;
            }
            System.out.println("还有"+(3-i)+"次机会");
        }

        if(flag){
            System.out.println("登录成功，进入系统");
        }else{
            System.out.println("登录失败");
        }

    }
}
